<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../css/base.css">
    <script src="../js/jquery-1.11.0.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/frameAll.js"></script>
    <script type="text/javascript">
        function toIframe(url, name) {
            if (url) {
                $("iframe").attr("src", url);
            }
            if (name) {
                $(".layui-layout-left .layui-nav-item").html(name);
            }
        }
    </script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">固定资产管理系统</div>

        <ul class="layui-nav layui-layout-left layui-bg-blue">
            <li class="layui-nav-item">首页</li>
        </ul>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:0;" id="info"></a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:0;" onclick="toIframe('info/setting.html','个人设置')">个人设置</a>
                    </dd>
                    <dd><a href="javascript:0;" onclick="toIframe('info/updatePassword.html','修改密码')">修改密码</a></dd>
                    <dd><a id="outLogin" href="javascript:0;">安全退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item">
                    <a href="javascript:0;" onclick="toIframe('user/list.html','用户管理')">用户管理</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:0;">资产管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:0;" onclick="toIframe('zc/out.html','资产借出')">资产借出</a></dd>
                        <dd><a href="javascript:0;" onclick="toIframe('zc/back.html','资产归还')">资产归还</a></dd>
                        <dd><a href="javascript:0;" onclick="toIframe('zc/inout.html','资产借还记录')">资产借还记录</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:0;">资产维护</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:0;" onclick="toIframe('zc/list.html','资产信息')">资产信息</a></dd>
                        <dd><a href="javascript:0;" onclick="toIframe('zc/send.html','资产送修')">资产送修</a></dd>
                        <dd><a href="javascript:0;" onclick="toIframe('zc/wx.html','资产维修')">资产维修</a></dd>
                        <dd><a href="javascript:0;" onclick="toIframe('zc/repair.html','资产维修记录')">资产维修记录</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:0;" onclick="toIframe('comployee/list.html','员工管理')">员工管理</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:0;" onclick="toIframe('','系统说明')">系统说明</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <iframe src="lunbotu.html" frameborder="0" height="100%" width="100%"></iframe>
    </div>

    <div class="layui-footer">
    </div>
</div>

<script>
    layui.use('util', function () {
        var util = layui.util;

        $(".layui-layout-left .layui-nav-bar").remove();
        $.ajax({
            type: "get",
            url: "/fixedAsset/getUser.do",
            dataType: "Json",
            success: function (data) {
                if (data.data) {
                    $("#info").html('欢迎用户：' + data.data.username);
                } else {
                    top.location.href = "/fixedAsset/";
                }
            },
            error: function () {
                top.location.href = "../login.html";
            }
        });
        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function (othis) {
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
        });

        $("#outLogin").click(function () {
            $.ajax({
                type: "get",
                url: "/fixedAsset/outLogin.do",
                dataType: "Json",
                success: function () {
                    top.location.href = "../login.html";
                }
            });
        });
    });
</script>
</body>
</html>